<%@ page language="java"  pageEncoding="UTF-8" contentType="text/html; charset=utf-8"%>
<%@ taglib prefix ="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
  <head>
    <title>晴天足迹</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link href="../css/back.css" rel="stylesheet" type="text/css">
     <script type="text/javascript" src="../js/kindeditor/kindeditor.js"></script>
	<link rel="stylesheet" type="text/css" 	href="../js/kindeditor/skins/default.css"></link>
	<script type="text/javascript" src="../js/jquery-1.4.2.js"></script>
   <script type="text/javascript" src="<%=basePath %>js/validator.js"></script>
	<script type="text/javascript">
	  function  checkSave(){
	     var  title=$("#title").val();
	     if(title.length==0){
	        alert("请填写足迹标题");
	        $("#title").focus();
	        return false;
	     }
	     if(KE.util.isEmpty('content')){
	          alert('请填写足迹内容');
	          return false;
	      }
	     if (!KE.util.isEmpty('content')) $("#content").val(KE.util.getData('content'));
	   
	   var  img=document.getElementById("image");
         if (checkNull(img)) {
			if (!checkImage(img)) {
			alert('图片上传格式不正确，应为 gif、png、jpg、jpeg、ico格式');
			img.focus();
			return false;
		}
		}
      }
	
	</script>	
  </head> 
  <body>
       <div id="all">
	      <div id="main">
          <form method="post" action="../school/saveOrUpdateSchool.shtml" enctype="multipart/form-data" onsubmit="return checkSave()">
      <table align="center">
         <tr><td colspan="2" align="center">晴天足迹</td></tr>
         <tr><td>语言类别：</td><td><select id= "lanType" name="photo.lanType" >
         <option value ="1" ${activityTable.lanType == 1?'selected':''} >中文</option>
         <option value ="2" ${activityTable.lanType == 2?'selected':''}>英文</option>
         </select></td></tr>
         <tr><td align="right">足迹标题：</td><td><input type="text" size="45" id="title" maxlength="46" name="photo.title" value="${photo.title}" /></td></tr>
         <tr><td align="right">足迹内容：</td><td><textarea name="photo.content" id="content" cols="80" rows="20">${photo.content}</textarea></td></tr>
          <s:if test="#request.photo.photo != null" >
              <tr><td align="right">足迹照片：</td><td>     <img src="../${photo.photo}"/><input type="file"  name="image" id="image"/></td></tr> 
          </s:if>
          <s:else>
          <tr><td align="right">足迹照片：</td><td><input type="file"  name="image" id="image"/></td></tr> 
          </s:else>
         <tr><td align="right">足迹感想：</td><td><textarea name="photo.emotion" id="emotion" cols="80" rows="20">${photo.emotion}</textarea></td></tr>
         <tr><td colspan="2" align="center">
         <input type="hidden" name="photo.id" value="${photo.id}">
         <input type="submit" value="保存"/>&nbsp;&nbsp;<input type="reset" value="重置"/></td></tr>
      </table>
      </form>
      </div>
      </div>
<script type="text/javascript">
     	KE.show({
				id : 'content',
				loadStyleMode : false,
				resizeMode : 0, 
				 allowUpload:true, //允许上传图片 
				imageUploadJson:'<%=basePath%>/comutil/upload.shtml',    
				items : [
				'fontname', 'fontsize', '|', 'textcolor', 'bgcolor', 'bold', 'italic', 'underline',
				'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
				'insertunorderedlist', '|','image']
			});
		KE.show({
				id : 'emotion',
				loadStyleMode : false,
				resizeMode : 0, 
				 allowUpload:true, //允许上传图片 
				imageUploadJson:'<%=basePath%>/comutil/upload.shtml',    
				items : [
				'fontname', 'fontsize', '|', 'textcolor', 'bgcolor', 'bold', 'italic', 'underline',
				'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
				'insertunorderedlist', '|','image']
			});	
  </script>
  </body>
</html>
